import * as Cesium from "cesium";

class CartesianLatLng {
  static latLngToCartesian(lat: number, lng: number, height: number) {
    return new Cesium.Cartesian3(lng, lat, height);
  }
  static CartesianToLatLng(cartesian1: Cesium.Cartesian3) {
    let cartographic = Cesium.Cartographic.fromCartesian(cartesian1);
    let lng = Cesium.Math.toDegrees(cartographic.longitude);
    let lat = Cesium.Math.toDegrees(cartographic.latitude);
    return {
      lng,
      lat,
      height: cartographic.height,
    };
  }
}
export default CartesianLatLng;
